import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
import { JsonApiService } from "app/core/api/json-api.service"; //http请求配置引入
import { config } from '../../shared/smartadmin.config';
declare var $: any;
declare var echarts: any;
declare var toMapPoint: any;
declare var INFOBOX_AT_TOP;
@Component({
	selector: 'chart1-component',
	templateUrl: './chart1.component.html',
	styleUrls: ['./chart1.css'],
})
export class Chart1Component implements OnInit {
	@Input() dataMapAuthority: any;//折线图宽度
	@Input() width: any;//折线图宽度
	@Input() height: any;//折线图高度
	@Input() authority: any;//显示AD的权限
	@Input() offDatas: any;//是否显示离线警报数据
	@Input() inputParams: any;//接收父组件的值 请求后台获取折线图数据 例:{deviceId:'',startTime:'',endTime:''}
	@Input() isBaiduMap: any;//是否有地图联动组件交互
	@Input() hideAD: any;// checkParams.lookSignal=false
	@Input() hideDB: any;// checkParams.loadometer=false
	@Input() hideSP: any;// checkParams.carSpeed=false
	@Input() isOpenMap: any;//checkParams.linetoMap=false
	@Input() noAbnormity: any;//不显示异常数据
	@Output() private outerSend = new EventEmitter();
	@Output() private outerIsMap = new EventEmitter();
	//折线图配置及画线参数
	myChart: any;
	echartOption: any;
	yAxiSignal: any;
	yAxiWeight: any;
	yAxiSpeed: any;
	isLoading: boolean = false; //判断是否在加载数据中
	checkParams = {
		isAllowCheck: true, 	// 是否有权限允许查看AD信号等
		lookSignal: false, 	// ad信号
		loadometer: true, 	// 地磅数据
		carSpeed: true, 		// 车辆速度
		linetoMap: false, 	// 地图联动
		showModify: true, 	// 数据修正
	};
	allData = [];
	allChartline = [];  //所有的折线数据
	passageName = [];
	passageArr = [];
	loadometerData = [];
	carSpeedArr = [];
	weightArr = [];
	linetoMapData = [];
	loadometerArr = [];
	//获取异常数据相关参数
	averageTime = 0;			//默认判断丢失数据的时间
	lostWeightMark = []; 		//计算丢失重量的时长
	nullGpsArr = []; 			//经纬度为空或者0.0的画折线数据
	nullMarkerData = []; 		//计算经纬度丢失的时长
	isLostGps = false; 			//是否有丢失经纬度
	isHavePoint = 0; 				//控制判断经纬度丢失起始结束位置计算时间条件
	//父组件传递过来 相关参数
	isInitChart: boolean = true; //判断是否初次父组件传递宽高及其他条件渲染图表

	offlineAbParams = [];
	clickOffPoint: any = {
		type: '',
		data: {},
	}
	correctParams: any = {
		tracklist: [],
		chart1line: [],
	}
	constructor(private jsonApiService: JsonApiService) { }
	//将数据传递到父组件
	sendParent(data) {
		this.outerSend.emit(data);
	}

	sendisMap() {
		this.outerIsMap.emit(this.checkParams.linetoMap);
	}
	linetoMapChange() {
		this.sendisMap();
	}
	ngOnChanges(changes) {
		if (this.inputParams && changes['inputParams']) {
			this.askforData();
		}
	}
	ngOnInit() {
		if (this.authority) {
			this.checkParams.isAllowCheck = false;
			this.checkParams.lookSignal = false;
			this.checkParams.loadometer = false;
		}

		if (this.hideAD) this.checkParams.lookSignal = false;
		if (this.hideDB) this.checkParams.loadometer = false;
		if (this.hideSP) this.checkParams.carSpeed = false;
		if (this.isOpenMap) this.checkParams.linetoMap = true;
		this.initChart();
	}


	initChart() {
		if (this.isInitChart) {
			this.initChartyAxi();
			this.initChartConfig();
			this.myChart = echarts.init(document.getElementById('myChart'));
			if (this.width) {
				$('.chartWarpBox').width(this.width + "px");
				this.myChart.getDom().style.width = this.width + "px";
			}

			if (this.height) {
				this.myChart.getDom().style.height = this.height + "px";
			}
			this.isInitChart = false;
			this.myChart.setOption(this.echartOption, true);
			this.myChart.resize();
			$(window).resize(this.myChart.resize);
			this.myChart.on('click', function (params) {
				if (params.componentType === 'markPoint') {
					if (params.name == "离线异常") {

						this.clickOffPoint = {
							type: 'clickOffPoint',
							data: params.data
						}
						this.sendParent(this.clickOffPoint);
					}

				}


			}.bind(this))
		}
	}

	//重置清空折线图相关参数
	initChartParams() {
		this.allData = []; 				//echart图后台请求回来的数据
		this.allChartline = []; 		//所有chart图折线的数组
		this.linetoMapData = []; 		//地图联动画轨迹数据
		this.loadometerData = []; 		//后台返回的地磅数据
		this.loadometerArr = []; 		//拼接成echart数组
		this.weightArr = []; 			//重量折线的数据
		this.carSpeedArr = [];			//速度折线的数据
		this.passageName = [];			//ad信号折线名
		this.passageArr = [];				//ad信号数据
		this.averageTime = 0;			//默认判断丢失数据的时间
		this.lostWeightMark = []; 		//计算丢失重量的时长
		this.nullGpsArr = []; 			//经纬度为空或者0.0的画折线数据
		this.nullMarkerData = []; 		//计算经纬度丢失的时长
		this.isLostGps = false; 		//是否有丢失经纬度
		this.isHavePoint = 0; 			//控制判断经纬度丢失起始结束位置计算时间条件
		if (this.echartOption) {
			this.echartOption.xAxis.data = [];
			this.echartOption.series = [];
			this.myChart.setOption(this.echartOption, true);
		}
	}

	getAbnormalData(i) {
		//计算经纬度等于0.0或者丢失的时候是时长start
		if (!this.allData[i] || !this.allData[i].x || this.allData[i].x == '0.0' || this.allData[i].x == '0') {
			if (this.isHavePoint < 1) {
				this.isHavePoint = i;
			}
		}
		else {
			if (this.isHavePoint > 0) {
				var lostTime = (common.mmsstoTimestamp(this.allData[i].uploadDate) - common.mmsstoTimestamp(this.allData[this.isHavePoint].uploadDate)) / 1000;
				if (lostTime > this.averageTime) {
					var point = {
						value: this.convertTime(lostTime),
						xAxis: this.isHavePoint,
						yAxis: this.allData[this.isHavePoint].weight
					};
					this.nullMarkerData.push(point);
				}
				this.isHavePoint = 0
			}
		}//计算end

		//获取丢失的数据
		if (i < this.allData.length - 1) {
			let lostStartime = common.mmsstoTimestamp(this.allData[i].uploadDate);
			let lostEndtime = common.mmsstoTimestamp(this.allData[i + 1].uploadDate);
			let lostime = (lostEndtime - lostStartime) / 1000;
			if (lostime > this.averageTime) {
				var myxy = {
					value: this.convertTime(lostime),
					xAxis: i,
					yAxis: this.allData[i].weight
				};
				this.lostWeightMark.push(myxy);
				//重量时间段丢失
			}
			if (!this.allData[i].x || this.allData[i].x == '0.0' || this.allData[i].x == '0') {
				//经纬度坐标丢失
				if (i > 0) {
					this.isLostGps = true;
					this.nullGpsArr[i] = this.allData[i].weight;
				}
			}
		}
	}
	//获取离线异常的数据
	getOffDatas(reqdata) {
		this.offlineAbParams = [];
		return new Promise(function (resolve, reject) {
			let resultArr = [];
			if (this.offDatas) {
				this.jsonApiService.http2("alertlog/queryDeviceShutDownAlarmList.html", reqdata).subscribe(result => {
					let len = result.data.length;
					let offlineError = [];
					if (len > 0) {
						for (let i = 0; i < len; i++) {
							let sort = 0;
							let item = result.data[i];
							let topos = toMapPoint({
								lng: item.lng,
								lat: item.lat,
							});
							if (topos) {
								item.lng = topos.lng;
								item.lat = topos.lat;
							};
							let tim = common.mmsstoTimestamp(item.offTime);
							for (let _i = sort; _i < this.allData.length; _i++) {
								let _item = this.allData[_i];
								let _tim = common.mmsstoTimestamp(_item.uploadDate);
								if (_tim - tim >= 0 && _i > 0) {
									sort = _i;
									let errorItem: any = {
										name: '离线异常',
										value: '离',
										xAxis: _i - 1,
										yAxis: this.allData[_i - 1].weight,
										lostime: '',
										symbol: 'image://assets/img/trackImage/ofline_jb.png',
										symbolSize: 28,
										symbolOffset: ['0', '-50%'],
									};
									for (let keys in item) {
										errorItem[keys] = item[keys];
									}
									offlineError.push(errorItem);
									break;
								}
							}
						}
					}
					this.offlineAbParams = offlineError;
					resolve();
				})
			} else {
				resolve();
			}
		}.bind(this))
	}
	//后台获取数据
	askforData() {
		if (!this.inputParams.deviceId) {
			this.jsonApiService.message('设备编号不能为空');
			return;
		}
		this.loadometerData = [];
		this.loadometerArr = [];
		let reqdata = 'deviceId=' + this.inputParams.deviceId + '&startTime=' + this.inputParams.startTime + '&endTime=' + this.inputParams.endTime + '&showModify=' + this.checkParams.showModify;
		this.jsonApiService.http2("weighbridge/weightforreal.html", reqdata).subscribe(result => {
			if (result.data.length >= 1) {
				this.loadometerData = result.data;
			}
		})
		this.initChartParams();
		layer.load();
		this.jsonApiService.http2("stats/drawforfixdatacheck.html", reqdata).subscribe(data => {
			layer.closeAll('loading');
			if (data.data.length < 2) {
				this.isLoading = false;
				this.jsonApiService.message('没有数据')
				this.sendParent({ type: 'trackline', data: [] });
				return;
			}
			this.allData = data.data;
			this.getOffDatas(reqdata).then(() => {
				this.coupudChartDatas();
			})
		})
	}
	//获取修正后的轨迹跟折线数据
	getCorrectDatas(result) {


		return new Promise(function (resolve, reject) {
			if (result.length < 2) {
				return;
			}
			this.correctParams = {
				tracklist: [],
				chart1line: [],
			}
			if (this.checkParams.showModify) {
				for (let i = 0; i < result.length; i++) {
					this.correctParams.chart1line[i] = result[i].rectifyWeight;
					this.correctParams.tracklist.push(result[i]);
				}
			}
			resolve();





		}.bind(this))





	}

	//计算折线图的数据
	coupudChartDatas() {
		this.carSpeedArr = [];
		let timeValue = [];
		let len = this.allData.length;
		this.averageTime = this.getAverageTime();
		this.correctParams = {
			tracklist: [],
			chart1line: [],
		}
		for (var i = 0; i < len; i++) {
			timeValue[i] = this.allData[i].uploadDate; //x时间轴数据
			this.weightArr[i] = parseFloat(this.allData[i].weight); //重量
			if (this.weightArr[i] < 0 && this.weightArr[i] >= -1) {
				this.weightArr[i] = 0;
			}
			let _speed = parseFloat(this.allData[i].speed); //速度
			if (_speed > -1) {
				this.carSpeedArr[i] = parseFloat(this.allData[i].speed);
			} else {
				this.carSpeedArr[i] = 0;
			}
			this.loadometerArr[i] = '-';//地磅数据
			this.nullGpsArr[i] = '-';	//经纬度空

			if (!this.noAbnormity) this.getAbnormalData(i);
			var mapPoint = toMapPoint(this.allData[i]);
			let lngX = +mapPoint.lng;
			let latY = +mapPoint.lat;
			if (lngX > 0 || lngX < 0) {
				if (latY > 0 || latY < 0) {
					this.linetoMapData.push(this.allData[i]);
				}
			}
			if (this.checkParams.showModify) {
				this.correctParams.chart1line.push(this.allData[i].rectifyWeight);
				this.correctParams.tracklist.push(this.allData[i]);
			}


		}


		for (let i = 0; i < this.offlineAbParams.length; i++) {
			let item = this.offlineAbParams[i];
			let isFind = false;
			for (let _i = 0; _i < this.lostWeightMark.length; _i++) {
				let iem = this.lostWeightMark[_i];
				if (item.xAxis < iem.xAxis + 2 && item.xAxis > iem.xAxis - 2) {
					item.lostime = iem.lostime;
					this.lostWeightMark[_i] = item;
					isFind = true;
					break;
				}
			}
			if (!isFind) this.lostWeightMark.push(item);
		}
		this.allChartline = [];

		this.sendParent({
			type: 'trackline',
			data: {
				track1: this.linetoMapData,
				correct: this.correctParams.tracklist,
			},
		});
		if (this.correctParams.chart1line.length > 3) {
			var correctWeight = {
				name: '修正后重量',
				type: 'line',
				borderWidth: 5,
				data: this.correctParams.chart1line,
				itemStyle: {
					color: '#c23531',
				}
			}
			this.allChartline.push(correctWeight)
		}
		var weightLine = {
			name: '原始重量',
			type: 'line',
			borderWidth: 5,
			data: this.weightArr,
			itemStyle: {
				color: '#4169e1',
			},
			markPoint: {
				data: this.lostWeightMark
			}
		}
		this.allChartline.push(weightLine)
		//时间轴
		this.echartOption.xAxis.data = timeValue;
		//ad信号
		this.showAdSignal();
		if (this.checkParams.carSpeed) {
			this.yAxiSpeed.min = 0;
			this.yAxiSpeed.max = 120;
			this.showCarSpeed();
		}
		if (this.checkParams.loadometer) {
			this.showLoadometer();
		}
		if (this.isLostGps) {
			this.allChartline.push({
				name: 'GPS异常',
				type: 'line',
				itemStyle: {
					color: 'gray'
				},
				lineStyle: {
					width: 3, //折线宽度
				},
				data: this.nullGpsArr,
				markPoint: {
					data: this.nullMarkerData
				}
			})
		}
		this.yAxiSignal.show = this.checkParams.lookSignal;
		this.yAxiSpeed.show = this.checkParams.carSpeed;
		this.echartOption.yAxis = [this.yAxiWeight, this.yAxiSignal, this.yAxiSpeed];
		this.echartOption.series = this.allChartline;
		this.myChart.setOption(this.echartOption, true);
		this.isLoading = false;
		this.myChart.resize();
	}

	//绘画ad信号折线,及丢失数据点.
	showAdSignal() {
		this.passageName = [];
		this.passageArr = [];
		var data = this.allData
		var len = data.length;
		let wareStatusArr = [];//手刹信号
		//nullPassArr中对应的值为空的时候,从allPassArr移除对应的通道数据,最终得到filterArr过滤后的数据this.passageArr
		var allPassArr = [];//16通道所有的数组        
		var nullPassArr = [];//记录通道全部数据是否为空.,默认值为true
		for (var z = 0; z < 16; z++) {
			var newArr = new Array();
			allPassArr.push(newArr);
			nullPassArr.push(true);
		}
		for (var i = 0; i < len; i++) {
			var handSingal = parseFloat(data[i].handBrakeHardwareStatus) * 10;//手刹信号放大10万倍
			if (handSingal >= 0 || handSingal < 0) {
				wareStatusArr[i] = handSingal;
			}
			for (var j = 0; j < 16; j++) {
				var name = 'aCH' + (j + 1);
				var passVal = parseFloat(data[i][name]);//获取16个通道的值;
				allPassArr[j][i] = passVal;
				if (passVal > 0 || passVal < 0) {
					nullPassArr[j] = false;
				}
			}
		}
		for (var _z = 0; _z < nullPassArr.length; _z++) {
			if (!nullPassArr[_z]) {
				var passName = '通道' + (_z + 1);
				this.passageName.push(passName);
				this.passageArr.push(allPassArr[_z]);
			}
		}
		this.passageName.push('手刹信号');
		this.passageArr.push(wareStatusArr);
		if (this.checkParams.lookSignal) {
			for (var _i = 0; _i < this.passageName.length; _i++) {
				var obj = {
					name: this.passageName[_i],
					type: 'line',
					yAxisIndex: 1,
					itemStyle: {
						color: common.lineGetColor(_i)
					},
					lineStyle: {
						width: 2, //折线宽度
						opacity: 0.75
					},
					data: this.passageArr[_i]
				};
				if (this.passageName[_i] === '手刹信号') {
					obj.itemStyle = {
						color: '#8B668B'
					};
					obj.yAxisIndex = 0;
				}
				this.allChartline.push(obj);
			}
		}

	}
	//地磅数据赋值到对应的折线数据位置上,若数据上有值则往后移
	loadometerVoluation(sort, weight) {
		if (sort + 1 <= this.loadometerArr.length) {
			if (this.loadometerArr[sort + 1] == '-') {
				this.loadometerArr[sort + 1] = weight;
			}
			else {
				this.loadometerVoluation(sort + 1, weight);
			}
		}
	}
	//获取地磅数据在chart图表显示.
	showLoadometer() {
		var orderIndex = 0;
		for (var x = 0; x < this.loadometerData.length; x++) {
			var time1 = common.mmsstoTimestamp(this.loadometerData[x].date);
			for (var i = orderIndex; i < this.allData.length; i++) {
				var time2 = common.mmsstoTimestamp(this.allData[i].uploadDate);
				orderIndex++;
				if (time2 - time1 >= 0) {
					let lmWeight = parseFloat(this.loadometerData[x].weight);
					this.loadometerVoluation(i - 1, lmWeight);
					break;
				}
			}
		}
		if (this.loadometerData.length >= 1) {
			let obj = {
				name: '地磅数据',
				type: 'scatter',
				yAxisIndex: 0,
				itemStyle: {
					color: 'orange'
				},
				data: this.loadometerArr
			};
			this.allChartline.push(obj);
		}
	}
	//绘画车辆速度折线
	showCarSpeed() {
		let obj = {
			name: '车辆速度',
			type: 'line',
			yAxisIndex: 2,
			itemStyle: {
				normal: {
					color: '#5793f3',
					lineStyle: {
						width: 1, //折线宽度
						opacity: 0.5,
					}
				}
			},
			data: this.carSpeedArr,
			areaStyle: {
				color: 'rgba(83, 146, 230,0.5)'
			}
		};
		this.allChartline.push(obj);
	}
	//ad信号选中画信号折线
	signalChange() {
		let len = this.passageArr.length;
		if (len >= 1) {
			if (this.checkParams.lookSignal) {
				for (var i = 0; i < len; i++) {
					//添加传感器通道数据
					var obj = {
						name: this.passageName[i],
						type: 'line',
						yAxisIndex: 1,
						itemStyle: {
							color: common.lineGetColor(i)
						},
						lineStyle: {
							width: 2, //折线宽度
							opacity: 0.75
						},
						data: this.passageArr[i]
					};
					if (this.passageName[i] === '手刹信号') {
						obj.itemStyle = {
							color: '#8B668B'
						};
						obj.yAxisIndex = 0;
					}
					this.allChartline.push(obj);
				}
			}
			else {
				var _len = this.allChartline.length;
				for (var _i = 0; _i < _len; _i++) {
					let findIndex = this.passageName.indexOf(this.allChartline[_i].name);
					if (findIndex > -1) {
						this.allChartline.splice(_i, 1);
						_len = _len - 1;
						_i = _i - 1;
					}

				}
			}
			this.yAxiSignal.show = this.checkParams.lookSignal;
			this.yAxiSpeed.show = this.checkParams.carSpeed;
			this.echartOption.yAxis = [this.yAxiWeight, this.yAxiSignal, this.yAxiSpeed];
			this.echartOption.series = this.allChartline;
			this.myChart.setOption(this.echartOption, true);
		}
	}
	//地磅数据选中画折线
	loadometerChange() {
		if (this.allData.length < 2) {
			return;
		}
		if (this.loadometerData.length >= 1) {
			if (this.checkParams.loadometer) {
				this.showLoadometer();
			}
			else {
				let len = this.allChartline.length;
				for (var i = 0; i < len; i++) {
					if (this.allChartline[i].name === '地磅数据') {
						this.allChartline.splice(i, 1);
						break;
					}
				}
			}
			this.echartOption.series = this.allChartline;
			this.myChart.setOption(this.echartOption, true);
		}
		else {
			if (this.checkParams.loadometer) {
				this.jsonApiService.message('该时间段没有地磅数据');
			}
		}
	}
	//车辆速度选中画折线
	carSpeedChange() {
		if (this.carSpeedArr.length >= 1) {
			if (this.checkParams.carSpeed) {
				this.yAxiSpeed.min = 0;
				this.yAxiSpeed.max = 120;
				this.showCarSpeed();
			}
			else {
				this.yAxiSpeed.min = undefined;
				this.yAxiSpeed.max = undefined;
				let len = this.allChartline.length;
				for (var i = 0; i < len; i++) {
					if (this.allChartline[i].name === '车辆速度') {
						this.allChartline.splice(i, 1);
						break;
					}
				}
			}
			this.yAxiSignal.show = this.checkParams.lookSignal;
			this.yAxiSpeed.show = this.checkParams.carSpeed;
			this.echartOption.yAxis = [this.yAxiWeight, this.yAxiSignal, this.yAxiSpeed];
			this.echartOption.series = this.allChartline;
			this.myChart.setOption(this.echartOption, true);
		}
	}
	//修正数据选中变更
	modifyChange() {
		if (this.isLoading) {
			this.jsonApiService.message('数据正在加载中,请稍后....')
			return;
		}
		if (this.allData.length < 1) {
			return;
		}
		this.isLoading = true;
		this.askforData();
	}
	//获取数据的平均时间
	getAverageTime() {
		let result = 5 * 60;
		let max = this.allData.length;
		//	if(max>10) max=10;
		for (var i = 0; i < max - 3; i++) {
			let time1 = common.mmsstoTimestamp(this.allData[i].uploadDate) / 1000;
			let time2 = common.mmsstoTimestamp(this.allData[i + 1].uploadDate) / 1000;
			let time3 = common.mmsstoTimestamp(this.allData[i + 2].uploadDate) / 1000;
			let timeCha = time2 - time1;
			if (time3 - time2 == timeCha) {
				if (timeCha > result) result = timeCha * 1.5;
				break;
			}
		}
		return result;
	}
	//转换时间格式
	convertTime(timeInt) {
		var d, h, m, s;
		if (timeInt >= 0) {
			d = Math.floor(timeInt / 60 / 60 / 24);
			h = Math.floor(timeInt / 60 / 60 % 24);
			m = Math.floor(timeInt / 60 % 60);
			s = Math.floor(timeInt % 60);
		}
		if (d < 1) {
			if (h < 1) {
				// 	 return m+'分'+s+'秒';
				return '约' + m + '分';
			} else {
				return h + '小时' + m + '分';
			}
		} else {
			return d + '天' + h + '小时' + m + '分';
		}
	}
	ngOnDestroy() { }
	initChartConfig() {
		this.echartOption = {
			tooltip: {
				trigger: 'axis',
				axisPointer: {
					type: 'cross' //十字星	
				},
				formatter: function (params) {
					if (this.checkParams.linetoMap) {
						var paramIndex = params[0].dataIndex;
						var pointObj = this.linetoMapData[paramIndex];
						if (!pointObj || pointObj.x == '' || pointObj.x == '0') {
							return;
						}
						this.sendParent({ type: 'movePoint', data: pointObj });
						if (!window.event) return;
						if (!window.event.type) return;
						var triggerType = window.event.type; //触发类型
						if (triggerType == 'click') {
							if (this.clickOffPoint.type == 'clickOffPoint') {
								this.sendParent(this.clickOffPoint);
								this.clickOffPoint = {};
							}
							else {
								//			          			if(this.checkParams.showModify){
								//			          				console.log(this.correctParams,paramIndex)
								//			          				pointObj=this.correctParams.tracklist[paramIndex];
								//			          			}
								this.sendParent({ type: 'clickPoint', data: pointObj });
							}
						}


					}
					var res = '';
					var len = params.length;
					for (var i = 0; i < len; i++) {
						res = res + params[i].marker + params[i].seriesName + ':' + params[i].data + '</br>'
					}
					return res;

				}.bind(this)
			},
			grid: {
				left: '48px',
				right: '120px',
				top: '12%',
				bottom: '18%'
			},
			toolbox: {
				feature: {
					dataView: { show: false, readOnly: false },
					restore: { show: false },
					saveAsImage: { show: false }
				}
			},
			legend: {
			},
			xAxis: {
				type: 'category',
				boundaryGap: false,
				data: [],
			},
			yAxis: [this.yAxiWeight],

			dataZoom: [{

				realtime: true
			}, {
				type: 'inside',
				realtime: true,
			}],
			series: [{
				name: '重量',
				type: 'line',
				data: []
			}]
		};
	}
	initChartyAxi() {
		this.yAxiWeight = {
			show: true,
			name: '重量',
			type: 'value',
			position: 'left',
			min: undefined,
			max: undefined,
			offset: undefined,
			axisLine: {
				lineStyle: {
					color: 'gray'
				}
			},
			axisLabel: {
				formatter: '{value}'
			}
		}
		this.yAxiSignal = {
			show: false,
			name: '信号',
			splitLine: {
				show: false
			},
			type: 'value',
			position: 'right',
			min: undefined,
			max: undefined,
			offset: undefined,
			axisLine: {
				lineStyle: {
					color: '#5c427c'
				}
			},
			axisLabel: {
				formatter: '{value}'
			}
		}
		this.yAxiSpeed = {
			show: false,
			name: '速度 KM/H',
			splitLine: {
				show: false
			},
			type: 'value',
			min: undefined,
			max: undefined,
			offset: 60,
			position: 'right',
			axisLine: {
				lineStyle: {
					color: '#5793f3'
				}
			},
			axisLabel: {
				formatter: '{value}'
			}
		}
	}
}
